-
Notifications
You must be signed in to change notification settings - Fork 19
feat: Add support for ping stream. #235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1e9486b to
dccfd48
Compare
| **/coverage/ | ||
| **/.flutter-plugins-dependencies | ||
| **/.flutter-plugins | ||
| **/devtools_options.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated, but this file was created when using the flutter dev tools.
2a28719 to
bbcebc5
Compare
packages/common_client/lib/src/data_sources/streaming_data_source.dart
Outdated
Show resolved
Hide resolved
bbcebc5 to
8f17351
Compare
8f17351 to
794c4fe
Compare
794c4fe to
77a7bd0
Compare
|
bugbot review |
| // we want to poll after 25 seconds. | ||
| final delay = Duration( | ||
| milliseconds: max( | ||
| milliseconds: min( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated minor bug, this should have been min to match the described logic. max will always just be the polling interval.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BEGIN_COMMIT_OVERRIDE
feat: Add support for ping stream.
fix: Expose polling configuration type.
END_COMMIT_OVERRIDE
The primary purpose of this PR is to add ping stream support to allow the flutter client SDK to work with relay proxy in streaming mode.
In order to add this functionality a bit of re-factoring has occurred. The core logic for doing a poll is now encapsulated into a "requestor". This ensures that the process used for making a poll in request to a "ping" event is using the same logic as a polling request.
Note
Adds SSE ping support that triggers a flags poll, extracting shared polling logic into a new Requestor and updating data sources and tests accordingly.
streaming_data_source.dart): handlepingevents; on ping, useRequestorto fetch all flags and emitDataEvent/StatusEvent; supports GET/REPORT; minor logging; exposeshttpClientFactoryfor ping requests.polling_data_source.dart): refactor to useRequestorfor requests; compute method fromuseReport; fix poll reschedule delay calculation; exposehttpClientFactory.requestor.dartencapsulates polling request logic (URL building, headers/body, ETag handling, environment ID extraction, error mapping) and returnsDataSourceEvent?.ld_common_client.dart: build a singlePollingDataSourceConfigand pass it toStreamingDataSourcefor ping-driven polls..gitignore: ignore**/devtools_options.yaml.Written by Cursor Bugbot for commit d7e211b. This will update automatically on new commits. Configure here.